<html>
<head><meta charset="utf-8"><title>Rustc cfg flags · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Rustc.20cfg.20flags.html">Rustc cfg flags</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="212905766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Rustc%20cfg%20flags/near/212905766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Rustc.20cfg.20flags.html#212905766">(Oct 10 2020 at 08:40)</a>:</h4>
<p>I would like to set many cfg option on rustc. But it fails, as I exceed max argument length. Is there a way to write them in a file, and let rustc read from this file?</p>



<a name="212928347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Rustc%20cfg%20flags/near/212928347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Rustc.20cfg.20flags.html#212928347">(Oct 10 2020 at 18:18)</a>:</h4>
<p>The context is this issue, where we try to use the kconfig from linux to build rust conditionally <a href="https://github.com/Rust-for-Linux/linux/issues/17">https://github.com/Rust-for-Linux/linux/issues/17</a></p>



<a name="212928465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Rustc%20cfg%20flags/near/212928465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Rustc.20cfg.20flags.html#212928465">(Oct 10 2020 at 18:21)</a>:</h4>
<p><span class="user-mention" data-user-id="322844">@Finn Behrens</span> Yes - you can use <code>@file</code> on the command line. See <a href="https://github.com/rust-lang/rust/blob/master/src/doc/rustc/src/command-line-arguments.md#path-load-command-line-flags-from-a-path">https://github.com/rust-lang/rust/blob/master/src/doc/rustc/src/command-line-arguments.md#path-load-command-line-flags-from-a-path</a></p>



<a name="212928476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Rustc%20cfg%20flags/near/212928476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Rustc.20cfg.20flags.html#212928476">(Oct 10 2020 at 18:21)</a>:</h4>
<p>Thanks a lot. Did not find that yet</p>



<a name="212933797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Rustc%20cfg%20flags/near/212933797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Finn Behrens <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Rustc.20cfg.20flags.html#212933797">(Oct 10 2020 at 20:44)</a>:</h4>
<p>Would be great if I could also set env variables in this file. But I don't find a flag of rustc to do this.</p>
<p>The idea is that I can have parameters, which can take a value, and so be read with then env! macro</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>